
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head >
    <style type="text/css">
        .htmleaf-container{
            margin:55px 5px 0px 80px;
        }
        #canvas-holder{
            margin-right: 150px;
        }
    </style>
    <!-- 页面meta -->
    <!--<meta charset="utf-8">-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge">-->

    <title>确诊患者管理 </title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">

    <!-- Tell the browser to be responsive to screen width -->
    <meta
            content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
            name="viewport">

    <link rel="stylesheet"
          th:href="@{/plugins/bootstrap/css/bootstrap.min.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/font-awesome/css/font-awesome.min.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/ionicons/css/ionicons.min.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/iCheck/square/blue.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/morris/morris.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/jvectormap/jquery-jvectormap-1.2.2.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/datepicker/datepicker3.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/daterangepicker/daterangepicker.css}">
    <link rel="stylesheet"
          th:href="@{/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/datatables/dataTables.bootstrap.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/treeTable/jquery.treetable.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/treeTable/jquery.treetable.theme.default.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/select2/select2.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/colorpicker/bootstrap-colorpicker.min.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/adminLTE/css/AdminLTE.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/adminLTE/css/skins/_all-skins.min.css}" type="text/css" >
    <link rel="stylesheet"
          th:href="@{/css/style.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/ionslider/ion.rangeSlider.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/ionslider/ion.rangeSlider.skinNice.css}" type="text/css">
    <link rel="stylesheet"
          th:href="@{/plugins/bootstrap-slider/slider.css}" type="text/css">
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div th:replace="commons/bar::#headerbar"></div>
<div  th:replace="commons/bar::#sidebar"></div>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            首页
            <small>疫情数据</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/index"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">疫情数据</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <!-- Small boxes (Stat box) -->
        <div class="row">
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-blue-gradient ">
                    <div class="inner">
                        <h4>目前确诊人数：[[${indexInfo.getCurrentPatientNumber()}]]</h4>

                        <p>累计确诊人数：[[${indexInfo.getSumPatientNumber()}]]</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-android-sad"></i>
                    </div>
                    <a href="/patient/list" class="small-box-footer">更多信息 <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-green">
                    <div class="inner">
                        <h4>治愈率：[[${indexInfo.cureRate}]]%<sup style="font-size: 20px"></sup></h4>

                        <p>治愈人数：[[${indexInfo.cureNumber}]]</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-android-walk"></i>
                    </div>
                    <a href="/cure/list" class="small-box-footer">更多信息 <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-yellow">
                    <div class="inner">
                        <h4>现存隔离人数:[[${indexInfo.currentTouchNumber}]]<sup style="font-size: 20px"></sup></h4>

                        <p>累计隔离人数：[[${indexInfo.sumTouchNumber}]]</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-android-home"></i>
                    </div>
                    <a href="/touch/list" class="small-box-footer">更多信息 <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>

            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-red">
                    <div class="inner">
                        <h4>死亡率：[[${indexInfo.deadRate}]]%<sup style="font-size: 20px"></sup></h4>

                        <p>死亡人数：[[${indexInfo.deadNumber}]]</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-arrow-expand"></i>
                    </div>
                    <a href="/dead/list" class="small-box-footer">更多信息 <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
        </div>
        <!-- /.row -->

        <!-- Main row -->

        <div class="row">
            <!-- Left col -->
                <div class="box-header with-border">

                </div>
                      <div class="htmleaf-container" >
                          <!--饼图-->
                        <div class="htmleaf-content">
                            <div style="float: left">
                                <div style="width:55%;margin:0 auto;" >
                                    <canvas id="canvas" height="650" width="800"></canvas>
                                </div>
                            </div >

                            <div id="canvas-holder" style="float: right">
                                <canvas id="chart-area" width="300" height="300"/>
                            </div>

                        </div>


                    </div>





        </header>

        </div>

            <script  src="js/Chart.js"></script>
            <script>
                Date.prototype.format = function (fmt) {
                    var o = {
                        "M+": this.getMonth() + 1, //月份
                        "d+": this.getDate(), //日
                        "h+": this.getHours(), //小时
                        "m+": this.getMinutes(), //分
                        "s+": this.getSeconds(), //秒
                        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
                        "S": this.getMilliseconds() //毫秒
                    };
                    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
                    for (var k in o)
                        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
                    return fmt;
                }

                var varray=[[${indexInfo.dates}]];

                var patientNums=[[${indexInfo.patientNums}]]
                var cureNums=[[${indexInfo.cureNums}]]
                console.log(varray);
                var lable=new Array(varray.length);
                for (i=0;i<varray.length;i++){
                    lable[i]=new Date(varray[i]).format("yyyy/MM/dd");
                }
                var lineChartData = {
                    labels : lable,
                    datasets : [
                        {
                            label: "累计确诊人数",
                            fillColor : "rgba(220,220,220,0.2)",
                            strokeColor : "rgba(220,220,220,1)",
                            pointColor : "rgba(220,220,220,1)",
                            pointStrokeColor : "#fff",
                            pointHighlightFill : "#fff",
                            pointHighlightStroke : "rgba(220,220,220,1)",
                            data : patientNums
                        },{
                            label: "累计治愈人数",
                            fillColor : "rgba(151,187,205,0.2)",
                            strokeColor : "rgba(151,187,205,1)",
                            pointColor : "rgba(151,187,205,1)",
                            pointStrokeColor : "#fff",
                            pointHighlightFill : "#fff",
                            pointHighlightStroke : "rgba(151,187,205,1)",
                            data : cureNums
                        }
                    ]

                }

                var pieData = [
                    {
                        value: [[${indexInfo.deadNumber}]],
                        color:"#F7464A",
                        highlight: "#FF5A5E",
                        label: "死亡人数"
                    },
                    {
                        value: [[${indexInfo.cureNumber}]],
                        color: "#46BFBD",
                        highlight: "#5AD3D1",
                        label: "治愈人数"
                    },


                    {
                        value: [[${indexInfo.getCurrentPatientNumber()}]],
                        color: "#3068be",
                        highlight: "#3d76be",
                        label: "现存确诊人数"
                    }

                ];
                window.onload = function(){
                    var ctx = document.getElementById("chart-area").getContext("2d");
                    var ctx2 = document.getElementById("canvas").getContext("2d");
                    window.myPie = new Chart(ctx).Pie(pieData);
                    window.myLine = new Chart(ctx2).Line(lineChartData, {
                        responsive: true
                    });
                };
            </script>
        <div style="text-align:center;clear:both">
            <script src="/gg_bd_ad_720x90-2.js" type="text/javascript"></script>
        </div>
    </section>
    <!-- /.content -->
</div>

<!-- /.content-wrapper -->

<script th:src="@{/plugins/jQuery/jquery-2.2.3.min.js}"></script>
<script th:src="@{/plugins/jQueryUI/jquery-ui.min.js}"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script th:src="@{/plugins/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{/plugins/raphael/raphael-min.js}"></script>
<script th:src="@{/plugins/morris/morris.min.js}"></script>
<script th:src="@{/plugins/sparkline/jquery.sparkline.min.js}"></script>
<script th:src="@{/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js}"></script>
<script th:src="@{/plugins/jvectormap/jquery-jvectormap-world-mill-en.js}"></script>
<script th:src="@{/plugins/knob/jquery.knob.js}"></script>
<script th:src="@{/plugins/daterangepicker/moment.min.js}"></script>
<script th:src="@{/plugins/daterangepicker/daterangepicker.js}"></script>
<script th:src="@{/plugins/daterangepicker/daterangepicker.zh-CN.js}"></script>
<script th:src="@{/plugins/datepicker/bootstrap-datepicker.js}"></script>
<script
        th:src="@{/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js}"></script>
<script
        th:src="@{/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js}"></script>
<script th:src="@{/plugins/slimScroll/jquery.slimscroll.min.js}"></script>
<script th:src="@{/plugins/fastclick/fastclick.js}"></script>
<script th:src="@{/plugins/iCheck/icheck.min.js}"></script>
<script th:src="@{/plugins/adminLTE/js/app.min.js}"></script>
<script th:src="@{/plugins/treeTable/jquery.treetable.js}"></script>
<script th:src="@{/plugins/select2/select2.full.min.js}"></script>
<script th:src="@{/plugins/colorpicker/bootstrap-colorpicker.min.js}"></script>
<script
        th:src="@{/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js}"></script>
<script th:src="@{/plugins/bootstrap-markdown/js/bootstrap-markdown.js}"></script>
<script
        th:src="@{/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js}"></script>
<script th:src="@{/plugins/bootstrap-markdown/js/markdown.js}"></script>
<script th:src="@{/plugins/bootstrap-markdown/js/to-markdown.js}"></script>
<script th:src="@{/plugins/ckeditor/ckeditor.js}"></script>
<script th:src="@{/plugins/input-mask/jquery.inputmask.js}"></script>
<script
        th:src="@{/plugins/input-mask/jquery.inputmask.date.extensions.js}"></script>
<script th:src="@{/plugins/input-mask/jquery.inputmask.extensions.js}"></script>
<script th:src="@{/plugins/datatables/jquery.dataTables.min.js}"></script>
<script th:src="@{/plugins/datatables/dataTables.bootstrap.min.js}"></script>
<script th:src="@{/plugins/chartjs/Chart.min.js}"></script>
<script th:src="@{/plugins/flot/jquery.flot.min.js}"></script>
<script th:src="@{/plugins/flot/jquery.flot.resize.min.js}"></script>
<script th:src="@{/plugins/flot/jquery.flot.pie.min.js}"></script>
<script th:src="@{/plugins/flot/jquery.flot.categories.min.js}"></script>
<script th:src="@{/plugins/ionslider/ion.rangeSlider.min.js}"></script>
<script th:src="@{/plugins/bootstrap-slider/bootstrap-slider.js}"></script>
<script>





    $(document).ready(function() {
        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale : 'zh-CN'
        });
    });

    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }

    $(document)
        .ready(
            function() {

                // 激活导航位置
                setSidebarActive("admin-datalist");

                // 列表按钮
                $("#dataList td input[type='checkbox']")
                    .iCheck(
                        {
                            checkboxClass : 'icheckbox_square-blue',
                            increaseArea : '20%'
                        });
                // 全选操作
                $("#selall")
                    .click(
                        function() {
                            var clicks = $(this).is(
                                ':checked');
                            if (!clicks) {
                                $(
                                    "#dataList td input[type='checkbox']")
                                    .iCheck(
                                        "uncheck");
                            } else {
                                $(
                                    "#dataList td input[type='checkbox']")
                                    .iCheck("check");
                            }
                            $(this).data("clicks",
                                !clicks);
                        });
            });
</script>
</body>

</html>